The following example uses the CodePanes and TopLine properties to display the line number of the top line in the specified code pane.
Debug.Print Application.VBE.CodePanes(3).TopLine